GRASS (programming Language)
   HOME

TheInfoList



OR:

GRASS (''GRAphics Symbiosis System'') is a
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
created to script 2D
vector graphics Vector graphics is a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display a ...
animations. GRASS was similar to
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
in syntax, but added numerous instructions for specifying 2D object animation, including scaling, translation and rotation over time. These functions were directly supported by the Vector General 3D
graphics terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and ...
GRASS was written for. It quickly became a hit with the artistic community who were experimenting with the new medium of
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
, and is most famous for its use by Larry Cuba to create the original "attacking the
Death Star The Death Star is a fictional space station and Weapon of mass destruction, superweapon featured in the ''Star Wars'' Space opera, space-opera franchise. Constructed by the autocratic Galactic Empire (Star Wars), Galactic Empire, the Death Star ...
will not be easy" animation in ''
Star Wars ''Star Wars'' is an American epic film, epic space opera multimedia franchise created by George Lucas, which began with the Star Wars (film), eponymous 1977 film and quickly became a worldwide popular culture, pop-culture Cultural impact of S ...
'' (1977). As part of a later partnership with
Midway Games Midway Games Inc., known previously as Midway Manufacturing and Bally Midway, and commonly known as simply Midway, was an American video game developer and publisher. Midway's franchises included ''Mortal Kombat'', ''Rampage (series), Rampage'' ...
, the language was ported to the Midway's
Z80 The Z80 is an 8-bit microprocessor introduced by Zilog as the startup company's first product. The Z80 was conceived by Federico Faggin in late 1974 and developed by him and his 11 employees starting in early 1975. The first working samples were ...
-based Z Box. This machine used
raster graphic upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
s and a form of sprites, which required extensive changes to support, along with animating color changes. This version was known as Zgrass.


History


GRASS

The original version of GRASS was developed by Tom DeFanti for his 1974
Ohio State University The Ohio State University, commonly called Ohio State or OSU, is a public land-grant research university in Columbus, Ohio. A member of the University System of Ohio, it has been ranked by major institutional rankings among the best publ ...
Ph.D. thesis. It was developed on a
PDP-11 The PDP-11 is a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of all models were sold, ...
/45 driving a Vector General 3DR display. As the name implies, this was a purely
vector graphics Vector graphics is a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display a ...
machine. GRASS included a number of vector-drawing commands, and could organize collections of them into a hierarchy, applying the various animation effects to whole "trees" of the image at once (stored in arrays). After graduation, DeFanti moved to the University of Illinois, Chicago Circle. There he joined up with Dan Sandin and together they formed the ''Circle Graphics Habitat'' (today known as the ''
Electronic Visualization Laboratory The Electronic Visualization Laboratory (EVL) is an interdisciplinary research lab and graduate studies program at the University of Illinois at Chicago, bringing together faculty, students and staff primarily from the Art and Computer Science depar ...
'', or EVL). Sandin had joined the university in 1971 and built the
Sandin Image Processor The Sandin Image Processor is a video synthesizer, usually introduced as invented by Dan Sandin and designed between 1971 and 1974.analog computer An analog computer or analogue computer is a type of computer that uses the continuous variation aspect of physical phenomena such as electrical, mechanical, or hydraulic quantities (''analog signals'') to model the problem being solved. In c ...
which took two video inputs, mixed them, colored the results, and then re-created TV output. He described it as the video version of a
Moog synthesizer The Moog synthesizer is a modular synthesizer developed by the American engineer Robert Moog. Moog debuted it in 1964, and Moog's company R. A. Moog Co. (later known as Moog Music) produced numerous models from 1965 to 1981, and again from 20 ...
. DeFanti added the existing GRASS system as the input to the IP, creating the GRASS/Image Processor, which was used throughout the mid-1970s. In order to make the system more useful, DeFanti and Sandin added all sorts of "one-off" commands to the existing GRASS system, but these changes also made the language considerably more idiosyncratic. In 1977 another member of the Habitat, Nola Donato, re-designed many of GRASS's control structures into more general forms, resulting in the considerably cleaner GRASS3. Larry Cuba's ''Star Wars'' work is based on semi-automated filming of a GRASS system running on a Vector General 3D terminal. The VG3D had internal hardware that performed basic transformations - scaling, rotation, etc. - in realtime without interacting with the computer. It is only during the times when new scenery is being presented that the much slower communications with the GRASS language takes place. This can be seen in the sequence, as the initial sections of the film show the
Death Star The Death Star is a fictional space station and Weapon of mass destruction, superweapon featured in the ''Star Wars'' Space opera, space-opera franchise. Constructed by the autocratic Galactic Empire (Star Wars), Galactic Empire, the Death Star ...
being rotated and scaled very rapidly, while the later sections simulating flight down the trench requires new scenery to be paged in from GRASS "trees". These can be seen appearing in groups.


Zgrass and UV-1

In 1977, DeFanti was introduced to Jeff Frederiksen, a chip designer working at
Dave Nutting Associates David Judd Nutting (December 26, 1930 – September 23, 2020) was an industrial design engineer who played a role in the early video game industry. He was a graduate of the Pratt Institute with a degree in industrial design. Career After leaving ...
. Nutting had been contracted by Midway, the videogame division of Bally, to create a standardized graphics driver chip. They intended to use it in most of their future arcade games, as well as a
video game console A video game console is an electronic device that Input/output, outputs a video signal or image to display a video game that can be played with a game controller. These may be home video game console, home consoles, which are generally placed i ...
they were working on which would later turn into the
Astrocade The ''Bally'' ''Astrocade'' (also known as ''Bally Arcade'' or initially as ''Bally ABA-1000'') is a second-generation home video game console and simple computer system designed by a team at Midway, at that time the videogame division of Bally ...
. Midway was quite interested in seeing the GRASS language running on their system, and contracted DeFanti to port it to the platform. A number of people at the Habitat, as well as some from Nutting, worked on the project, which they referred to as the Z Box. GRASS3 running on it became Zgrass. The Z-Box was a
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
machine, unlike the original GRASS systems, so while most of the GRASS3 style was maintained in Zgrass, it added a number of commands dedicated to raster images. This included an extensive set of
bit block transfer Bit blit (also written BITBLT, BIT BLT, BitBLT, Bit BLT, Bit Blt etc., which stands for ''bit block transfer'') is a data operation commonly used in computer graphics in which several bitmaps are combined into one using a ''boolean function''. The ...
commands in order to simulate sprites, something the hardware didn't include. The work would never be released by Midway, but the Circle would produce machines based on it as the
Datamax UV-1 {{no footnotes, date=May 2014 The Datamax UV-1 is a pioneering computer designed by a group of computer graphics artists working at the University of Illinois at Chicago, known as the ''Circle Graphics Habitat''. It was primarily the brainchild of ...
. The last version of GRASS was RT/1, a port of GRASS to other platforms that divorced the language from the display model and allowed it to be ported to other platforms. Versions existed for
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few ope ...
,
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
,
SGI SGI may refer to: Companies *Saskatchewan Government Insurance *Scientific Games International, a gambling company *Silicon Graphics, Inc., a former manufacturer of high-performance computing products *Silicon Graphics International, formerly Rac ...
platform using
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
,
HP-UX HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V (initially System III) and first released in 1984. Current versions support HPE Integrity Ser ...
,
AIX Aix or AIX may refer to: Computing * AIX, a line of IBM computer operating systems *An Alternate Index, for a Virtual Storage Access Method Key Sequenced Data Set * Athens Internet Exchange, a European Internet exchange point Places Belgi ...
,
Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc., Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and ...
and
Amiga Amiga is a family of personal computers introduced by Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and significantly improved graphi ...
. The language remains similar to the earlier versions, so the reason for the change of name is unclear.


Description

:''This description is based on the original Bally manuals as well as the ACM description. Zgrass was based on a standard set of BASIC commands and used most of its syntax. Where Zgrass differed from BASIC was that all commands were in fact
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
s and returned values, similar to the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well as ...
. If there was no obvious return value it was expected that a function would return 1 if it succeeded, and 0 if it failed. For instance, the command PRINT PRINT 10 would be illegal in BASIC, but in Zgrass this would print 10 1, the 1 being the value returned by second PRINT, meaning "I successfully output the string '10'". Programs in Zgrass were referred to as "macros", and stored as strings. Both of these oddities were deliberate, as Zgrass allowed any string to become a program. For instance, MYBOX="BOX 0,0,100,100,2" defines a string (no need for a $ on the variable as in
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first ve ...
s) containing a snippet of Zgrass code. Simply typing from that point on would run the command(s) inside. This feature can be used in place of the more traditional GOSUB command from BASIC, but has the added advantage of having a well-defined name as opposed to an opaque line number. In addition, the command remains in the form of a string in memory and can be manipulated at runtime with standard string operations. Most BASIC
interpreters Interpreting is a translational activity in which one produces a first and final target-language output on the basis of a one-time exposure to an expression in a source language. The most common two modes of interpreting are simultaneous inter ...
of the era converted the input text into a ''
tokenized In computer science, lexical analysis, lexing or tokenization is the process of converting a sequence of characters (such as in a computer program or web page) into a sequence of ''lexical tokens'' ( strings with an assigned and thus identified ...
'' version in which each of the commands was replaced by a single number (typically one
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
long). This made the program run faster because it didn't have to continually decode the commands from the strings every time. Zgrass's use of string-based macros made this difficult, so they didn't bother with tokenization. Instead, they included a
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
which could be used on any particular macro, speeding it up many times. Programs would often consist of a mix of compiled and uncompiled macros. Line numbers were optional in Zgrass, and typically only appeared on lines that were the target of a GOTO. Most BASIC interpreters required line numbers for every line of code, but this was due to their use in the "line editor"–if you needed to edit a particular line, the only way to refer to it was by number. Zgrass used a more advanced full-screen editor that eliminated this need. Zgrass allowed any string to act as a "line number", and were both valid. Zgrass also included nameless branches, using the instruction, which would move forward or back a given number of lines. This is important in Zgrass as the line numbers were optional and different macros might make use of the same labels. For instance, some variation on is likely to be found in many bits of code, and thus might result in a name clash. Using avoided this possibility. In keeping with its original purpose as a graphics language, Zgrass included numerous commands for simple drawing. Zgrass's coordinate system had one point for each pixel in the high-resolution mode of Nutting's graphics chip, giving a 320×202 grid. The Astrocade, by design, could only use that chip's low-resolution mode, a 160×101 display. To avoid potential mapping problems, the coordinate space's zero point was placed in the center of the screen. −160 to 160 were valid X locations, and -101 to 101 valid Y locations. For use on the Astrocade you used the positive locations only, whereas on the UV-1 the entire space was available. Zgrass added a fairly complete set of array functions, as arrays are widely used in graphics. This included the ability to "capture" parts of the display into an array as a
bitmap In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that c ...
, which could then be manipulated as any other graphic item. This allowed Zgrass to include sprite-like functionality in the language, something the Nutting hardware did not directly include. Another feature the Astrocade did not include was the ability to process arrays with any reasonable speed, so the UV-1 included a Zilog supplied FPU for added performance. Zgrass included three priorities (called ''levels'') that allowed macros to be run normally, or in "foreground" or "background" levels. This added a simple form of multitasking which was tremendously useful in an animation-oriented language. Game authors could place joystick-reading routines in a macro set to run in the background, and then the joystick would be read automatically whenever the current drawing macro completed. Functions placed in the foreground ran before either, and was often used for timers and other "low latency" needs. Zgrass included a function that would call macros on a timed basis, making the implementation of timers very easy. Zgrass also included a series of commands that "covered" CP/M, which allowed the disk to be accessed without exiting to the command prompt. You could easily save out macros to named files, and load them in the same way, allowing you to construct programs by loading up various macros from the disk into one large program. The commands also automatically made a backup copy of every save. Similar features were supported for
Compact Cassette The Compact Cassette or Musicassette (MC), also commonly called the tape cassette, cassette tape, audio cassette, or simply tape or cassette, is an analog magnetic tape recording format for audio recording and playback. Invented by Lou Ottens ...
storage, but oddly the syntax was not parallel: disk commands were D-something, like , but tape commands were not T-something, like , but rather something-TAPE, like . With programs constructed from randomly selected modules, Zgrass needed to have better control over its variables than BASIC. In BASIC all variables are "global", so if two subroutines both use the variable , which is very commonly used as a loop index variable, then they could set each other's values which leads to hard-to-debug problems. Under Zgrass a programmer loading up two modules could easily find that both used as a loop counter, which could cause problems. To address this issue, Zgrass considered variables named with
lowercase Letter case is the distinction between the Letter (alphabet), letters that are in larger uppercase or capitals (or more formally ''majuscule'') and smaller lowercase (or more formally ''minuscule'') in the written representation of certain lang ...
letters to be local only to that macro, so and were different variables, global and local respectively. Oddly, the examples provided with the language do not make widespread use of this feature, potentially confusing new programmers who might not be aware the feature exists.


Example

This text creates a new macro called SINCURVE that can be called simply by typing SINCURVE into the command prompt, or from other macros or programs. SINCURVE uses two local variables, x and angle, as well as a global variable, OFFSET. The PROMPT/INPUT is a modification of the original BASIC INPUT which will not ask for the input if the user types it into the command line when calling the macro. In this case, typing SINCURVE will result in the prompt appearing and the program waiting for input, whereas typing SINCURVE 30 will skip the prompt and OFFSET will automatically be assigned 30. This allows a single macro to be used both interactively and within a program as a function. POINT is an example of one of the many graphics commands included in the Zgrass language. POINT requires an X and Y location, as well as a color. In this example, the user supplied OFFSET moves the x position of the curve on the screen, while the Y position is supplied by the trig function, suitably enlarged for display (in this case, 80 times). The color is supplied in the last input, and in this case is 3. The UV-1 used color registers, so 3 did not imply a particular color, but a color selected from the current palette. The IF is likewise notable. It places an increment, (x=x+1), in front of the test, a feature not normally available in BASIC. In this case the IF is told to call SKIP -2 if true, which will move back two lines and can be used in place of a GOTO, as there is no line number target.


Notes


References


Citations


Bibliography

* * {{BASIC Procedural programming languages Programming languages created in 1974 Star Wars (film) BASIC programming language family